package com.ruoyi.testPackage;


import com.github.pagehelper.PageHelper;
import com.ruoyi.RuoYiApplication;
import com.ruoyi.common.exception.CustomException;
import com.ruoyi.common.utils.ImageUtils;
import com.ruoyi.meterManager.domain.MeterPicture;
import com.ruoyi.meterManager.domain.requestDto.UpdateMrEntity;
import com.ruoyi.meterManager.domain.responseDto.MeterCbHis;
import com.ruoyi.meterManager.domain.responseDto.MeterCursor;
import com.ruoyi.meterManager.domain.responseDto.pgtest;
import com.ruoyi.meterManager.mapper.MeterPictureMapper;
import com.ruoyi.meterManager.mapper.MeterreadMapper;
import com.ruoyi.meterManager.service.MeterreadService;
import org.apache.ibatis.session.ResultContext;
import org.apache.ibatis.session.ResultHandler;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;

import java.awt.*;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.List;

/**
 * @program: ruoyi
 * @description:
 * @author: Chenhenan
 * @create: 2021-03-10 10:17
 **/
@SpringBootTest(classes=RuoYiApplication.class)
@RunWith(SpringRunner.class)
public class test1 {

    @Autowired
    MeterPictureMapper pictureMapper;
    @Autowired
    MeterreadMapper meterreadMapper;

    /*public static void main(String[]
    ) {
        String output = "C:/Users/ASUS/Desktop/t/";
        String source = "C:/Users/ASUS/Desktop/t/abc.jpg";  //源图片路径
        String imageName = "abc"; //图片名称
        String imageType = "jpg"; //图片类型jpg,jpeg,png,gif
        List<String> words = new ArrayList<>();
        words.add("账卡号：01237865");
        words.add("用户号：891233564  用户名：张三");
        words.add("詹姆斯/摄 2021-11-29 15:11:06");
        Color color = Color.red;
        Integer degree = null; //水印旋转角度-45，null表示不旋转
        String result = null;

        //给图片添加文字水印
        ImageUtils.markImageByMoreText(source,output,imageName,imageType,color,words,degree);

        System.out.println(result);
    }*/

    @Test
    public void a(){

/*        Map param = new HashMap();
        param.put("i_num","100028");*/
        UpdateMrEntity updateMrEntity = new UpdateMrEntity();
        updateMrEntity.setMiid("111");

        //param.put("c","100028");
       // param.put("c",new ArrayList<pgtest>());
        meterreadMapper.test123(updateMrEntity);
        String c = updateMrEntity.getO_out_trans();
        System.out.println(c);

        /*Map param = new HashMap();
        param.put("P_BFRPER","100028");
        param.put("P_MIID","2312662860");
        MeterCursor meterCursor = meterreadMapper.selectDetailByMrId(param);
        System.out.println(meterCursor);*/
//        List<MeterCursor> meterCursors = meterreadMapper.selectCursor("100028");
//        System.out.println(meterCursors);

    }


    public static void main(String[] args) {
        LinkedHashMap lk = new LinkedHashMap<>();

        String filenumber = (String)lk.get("filenumber");//客户代码
        System.out.println(filenumber);
    }


}